package com.greenline.push.core.pushcenter.impl;

import org.springframework.beans.factory.annotation.Autowired;

import com.greenline.push.core.pushcenter.MsgHisManager;
import com.greenline.push.dal.pushcenter.MsgHisDao;
import com.greenline.push.dal.pushcenter.dataobject.MsgHisDO;
import com.greenline.push.dal.query.MsgHisQuery;

public class MsgHisManagerImpl implements MsgHisManager {
    @Autowired
    private MsgHisDao msgHisDao;

    @Override
    public Long insert(MsgHisDO msgHisDO) {
        return msgHisDao.insert(msgHisDO);
    }

    @Override
    public boolean update(MsgHisDO msgHisDO) {
        if (null == msgHisDO) {
            return false;
        }
        return msgHisDao.update(msgHisDO) > 0;
    }

    @Override
    public MsgHisQuery listByQuery(MsgHisQuery query) {
        return msgHisDao.listByQuery(query);
    }

    @Override
    public MsgHisDO getById(Long id) {
        return msgHisDao.getById(id);
    }

    @Override
    public boolean delete(Long id) {
        if (null == id) {
            return false;
        }
        return msgHisDao.deleteById(id) > 0;
    }

}
